// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2024 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.13.1
package sysin

import (
	"context"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"

	"github.com/gogf/gf/v2/frame/g"
)

// StockBlockUpdateFields 修改板块轮动字段过滤
type StockBlockUpdateFields struct {
	Code     string  `json:"code"     dc:"code"`
	Name     string  `json:"name"     dc:"名称"`
	Date     string  `json:"date"     dc:"日期"`
	Desc     string  `json:"desc"     dc:"爆发原因"`
	Strength float64 `json:"strength" dc:"板块强度"`
}

// StockBlockInsertFields 新增板块轮动字段过滤
type StockBlockInsertFields struct {
	Code     string  `json:"code"     dc:"code"`
	Name     string  `json:"name"     dc:"名称"`
	Date     string  `json:"date"     dc:"日期"`
	Desc     string  `json:"desc"     dc:"爆发原因"`
	Strength float64 `json:"strength" dc:"板块强度"`
}

// StockBlockEditInp 修改/新增板块轮动
type StockBlockEditInp struct {
	entity.StockBlock
}

func (in *StockBlockEditInp) Filter(ctx context.Context) (err error) {
	// 验证code
	if err := g.Validator().Rules("required").Data(in.Code).Messages("code不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证日期
	if err := g.Validator().Rules("required").Data(in.Date).Messages("日期不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type StockBlockEditModel struct{}

// StockBlockDeleteInp 删除板块轮动
type StockBlockDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockBlockDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type StockBlockDeleteModel struct{}

// StockBlockViewInp 获取指定板块轮动信息
type StockBlockViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockBlockViewInp) Filter(ctx context.Context) (err error) {
	return
}

type StockBlockViewModel struct {
	entity.StockBlock
}

// StockBlockListInp 获取板块轮动列表
type StockBlockListInp struct {
	form.PageReq
	Id   int    `json:"id"   dc:"id"`
	Code string `json:"code" dc:"code"`
	Name string `json:"name" dc:"名称"`
	Date string `json:"date" dc:"日期"`
}

func (in *StockBlockListInp) Filter(ctx context.Context) (err error) {
	return
}

type StockBlockListModel struct {
	Id       int     `json:"id"       dc:"id"`
	Code     string  `json:"code"     dc:"code"`
	Name     string  `json:"name"     dc:"名称"`
	Date     string  `json:"date"     dc:"日期"`
	Desc     string  `json:"desc"     dc:"爆发原因"`
	Strength float64 `json:"strength" dc:"板块强度"`
}

// StockBlockExportModel 导出板块轮动
type StockBlockExportModel struct {
	Id       int     `json:"id"       dc:"id"`
	Code     string  `json:"code"     dc:"code"`
	Name     string  `json:"name"     dc:"名称"`
	Date     string  `json:"date"     dc:"日期"`
	Desc     string  `json:"desc"     dc:"爆发原因"`
	Strength float64 `json:"strength" dc:"板块强度"`
}
